@echo off
setlocal EnableDelayedExpansion

set WINSCP_PATH=C:\Program Files (x86)\WinSCP\WinSCP.com
set PI_ADDRESS=pi@192.167.100.60
set PI_PASSWORD=Mindteco
set PI_REMOTE_PATH=/home/pi/Project/build/page_py/py
set LOCAL_DIST_PATH=%CD%

"%WINSCP_PATH%" /command ^
    "open %PI_ADDRESS% -password=%PI_PASSWORD%" ^
    "lcd %LOCAL_DIST_PATH%" ^
    "cd %PI_REMOTE_PATH%" ^
    "put *.py" ^
    "put *.ini" ^
    "call sudo sync" ^
    "call sudo supervisorctl restart pywsgi" ^
    "exit"
